dsconfig: base#771
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dsconfig-backed base schema for the GitHub datasource plugin, commits the generated schema artifacts, and ensures those artifacts ship with the built plugin bundle. It also adjusts backend settings parsing to tolerate legacy appId/installationId representations and updates dependencies/build wiring accordingly.
Changes:
- Introduce dsconfig schema source (
pkg/schema/dsconfig.json), Go helpers/tests, and generated schema artifacts (pkg/schema/*.gen.json). - Package schema artifacts (and skills) into
dist/via a new rootwebpack.config.tsand updatedpackage.jsonbuild/dev scripts. - Normalize legacy
appId/installationIdparsing inpkg/models/settings.goand update tests; minor test determinism fix and SDK config API update.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.ts | Extends scaffolded webpack config to copy schema artifacts (and skills) into the built bundle. |
| pkg/schema/dsconfig.json | Adds dsconfig “single source of truth” schema for plugin settings. |
| pkg/schema/schema.go | Embeds dsconfig schema and produces SDK plugin schema object. |
| pkg/schema/schema_test.go | Adds artifact generation via go generate and runs dsconfig conformance tests. |
| pkg/schema/schema.gen.json | Committed generated plugin schema (v0alpha1). |
| pkg/schema/settings.gen.json | Committed generated settings schema (v0alpha1). |
| pkg/schema/settings.examples.gen.json | Committed generated settings examples artifact. |
| pkg/models/settings.go | Adds legacy-tolerant JSON unmarshal for appId/installationId and adds githubPlan for frontend parity. |
| pkg/models/settings_test.go | Updates expectations for the new normalized appId/installationId representation. |
| pkg/github/stargazers_test.go | Makes time zone formatting deterministic for golden output. |
| pkg/github/sql_handler_test.go | Switches to config.NewGrafanaCfg per updated plugin SDK API. |
| package.json | Bumps version and switches build/dev scripts to use the new root webpack config. |
| go.mod | Updates Go/tooling and dependency versions; adds dsconfig modules. |
| go.sum | Updates module checksums to match go.mod changes. |
| cspell.config.json | Adds dsconfig-related words and formats ignore list. |
| CHANGELOG.md | Documents 2.8.2 changes and adjusts prior formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jcolladokuri
left a comment
There was a problem hiding this comment.
some nits, otherwise LGTM, thanks!
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| 'grafana-github-datasource': patch | |||
There was a problem hiding this comment.
changeling + version bump instead?
|
|
||
| // Force a fixed +0000 zone so the rendered time is deterministic across | ||
| // environments/Go versions (always "+0000" instead of "UTC"/"GMT"). | ||
| starredAt = starredAt.In(time.FixedZone("", 0)) |
There was a problem hiding this comment.
not sure I follow why we needed to add this, was the test failing?
| github.com/grafana/otel-profiling-go v0.5.1 // indirect | ||
| github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect | ||
| github.com/grafana/dsconfig/dsconfig v0.0.12 // indirect | ||
| github.com/grafana/dsconfig/schema v0.0.12 // indirect |
There was a problem hiding this comment.
shouldn't this be a direct dependency? There also seem to be a lot of updates here, is that needed / expected?
| @@ -0,0 +1,296 @@ | |||
| { | |||
| "$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.10/dsconfig/schema.json", | |||
There was a problem hiding this comment.
| "$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.10/dsconfig/schema.json", | |
| "$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.12/dsconfig/schema.json", |
Summary
This PR adds the datasource configuration schema for the datasource. With the schema consumers such as llm agents, provisioning agents, etc will understand the shape and meta data about the datasource configuration.
Read more at